package com.zjc.stock.strategy;

import com.zjc.stock.utils.DoubleUtil;

/**
 * 交易计划
 */
public class TradingPlan {

    private static Double maxPrice = 8.0;  //目标价
    private static Double minPrice = 1.1; // 最低价
    private static Double positionBuildingPrice = 7.1; // 建仓点

    private static Double diffPrice = 0.2; // 买卖差价
    private static Double profitDiffPrice = 0.1; // 买卖差价

    public static void main(String[] args) {

        Double currentPrice = positionBuildingPrice;
        int positionBuildingCount = 0;
        /**
         * 建仓买入
         */
        while (currentPrice < maxPrice) {
            System.out.print("买入价：" + currentPrice + " ");
            System.out.print("卖出价：" + DoubleUtil.add(currentPrice, profitDiffPrice) + " ");
            currentPrice = DoubleUtil.add(currentPrice, diffPrice);
            positionBuildingCount++;
        }
        System.out.println();
        System.out.println("建仓：" + positionBuildingPrice + " " + positionBuildingCount + "笔");


        Double price = minPrice;
        /**
         * 交易计划
         */
        while (price < maxPrice) {
            System.out.println("买入价：" + price + " ");
            System.out.println("卖出价：" + DoubleUtil.add(price, profitDiffPrice) + " ");
            price = DoubleUtil.add(price, diffPrice);
        }
    }
}
